// 模型详情页面的JavaScript

// 侧边栏激活状态管理
document.addEventListener('DOMContentLoaded', function() {
    // 获取当前页面路径
    const currentPath = window.location.pathname;
    const filename = currentPath.split('/').pop();
    
    // 查找所有导航链接
    const navLinks = document.querySelectorAll('.sidebar-menu a');
    
    // 设置活动链接
    navLinks.forEach(link => {
        const linkHref = link.getAttribute('href');
        if (linkHref === filename || 
            (filename === '' && linkHref === 'qd-display.html') || 
            (filename === 'index.html' && linkHref === 'qd-display.html') ||
            (currentPath.includes(linkHref))) {
            link.classList.add('active');
        } else {
            link.classList.remove('active');
        }
    });
}); 